load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "parquet",
    srcs = [
        "decoders.go",
        "schema.go",
        "testutils.go",
        "write_functions.go",
        "writer.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/util/parquet",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/geo",
        "//pkg/geo/geopb",
        "//pkg/sql/pgrepl/lsn",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/sem/catid",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util",
        "//pkg/util/bitarray",
        "//pkg/util/buildutil",
        "//pkg/util/duration",
        "//pkg/util/encoding",
        "//pkg/util/envutil",
        "//pkg/util/timeofday",
        "//pkg/util/uuid",
        "@com_github_apache_arrow_go_v11//parquet",
        "@com_github_apache_arrow_go_v11//parquet/compress",
        "@com_github_apache_arrow_go_v11//parquet/file",
        "@com_github_apache_arrow_go_v11//parquet/metadata",
        "@com_github_apache_arrow_go_v11//parquet/schema",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_lib_pq//oid",
        "@com_github_stretchr_testify//require",
    ],
)

go_test(
    name = "parquet_test",
    srcs = [
        "writer_bench_test.go",
        "writer_test.go",
    ],
    embed = [":parquet"],
    deps = [
        "//pkg/geo",
        "//pkg/sql/randgen",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util/bitarray",
        "//pkg/util/duration",
        "//pkg/util/ipaddr",
        "//pkg/util/json",
        "//pkg/util/timeutil",
        "//pkg/util/timeutil/pgdate",
        "//pkg/util/uuid",
        "@com_github_apache_arrow_go_v11//parquet/file",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
